package com.greatchn.authorization_server.web.po;

import org.hibernate.annotations.Proxy;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * @OauthConfig:
 * @author: ZBoHang
 * @time: 2023/2/28 13:54
 */
@Entity
@Table(name = "oauth_config", schema = "sso", catalog = "")
@Proxy(lazy = false)
public class OauthConfig implements Serializable {
    private static final long serialVersionUID = -2158423855887215070L;
    private String key;
    private String value;
    private String desc;
    private String state;

    @Id
    @Column(name = "key", nullable = false, length = 255)
    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    @Basic
    @Column(name = "value", nullable = true, length = 255)
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Basic
    @Column(name = "desc", nullable = true, length = 255)
    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Basic
    @Column(name = "state", nullable = true, length = 1)
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OauthConfig that = (OauthConfig) o;
        return Objects.equals(key, that.key) && Objects.equals(value, that.value) && Objects.equals(desc, that.desc) && Objects.equals(state, that.state);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, value, desc, state);
    }
}
